package com.library.control.log;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import com.library.model.dto.notice.NoticeDTO;
import com.library.model.service.NoticeService;

public class NoticeBoardDetailController extends AbstractController{
	
	private NoticeService noticeservice;
	
	public void setNoticeservice(NoticeService noticeservice) {
		this.noticeservice = noticeservice;
	}

	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		int a_seq = Integer.parseInt(request.getParameter("a_seq"));
		ModelAndView mav = new ModelAndView();
		NoticeDTO detail = noticeservice.getNotice(a_seq);
		mav.addObject("detail", detail);
		mav.setViewName("noticedetail");
		
		return mav;
	}

}
